s=str(input()).lower()
s2=str(input()).lower()
cnt = 0
for i in s:
    if(i == s2):
       cnt+=1
print(cnt)